﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Net;
using System.IO;

namespace WebViecLam
{
    public partial class DanhSachTuyenDungTheoNganh : System.Web.UI.Page
    {
        private string strRequestMajorRSS = "";

        protected void Page_Load(object sender, EventArgs e)
        {
            int majorID = Int32.Parse(Request.QueryString["id"]);
            switch(majorID)
            {
                case 1:
                    strRequestMajorRSS = "http://localhost:8080/ViecLamService/InformationTechnology.rss";
                    break;

                case 2:
                    strRequestMajorRSS = "http://localhost:8080/ViecLamService/Doctor.rss";
                    break;
            }

            HttpWebRequest request = (HttpWebRequest)(WebRequest.Create(strRequestMajorRSS));
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            StreamReader streamReader = new StreamReader(response.GetResponseStream());

            // string xml
            string xmlData = streamReader.ReadToEnd();

            XmlDSLstEnrollsWithMajorID.Data = xmlData;
            
            DataListLstEnrollsWithMajorID.DataSource = XmlDSLstEnrollsWithMajorID;
            DataListLstEnrollsWithMajorID.DataBind();
        }
    }
}
